﻿using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace Saturn.App.Common
{
    /// <summary>
    /// 公共声音类
    /// </summary>
    public class CommonSound
    {
        #region 系统发出声音
        [DllImport("coredll.dll", EntryPoint = "MessageBeep", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Winapi)]
        //音效
        public static extern bool MessageBeep(int type);
        //发出不同类型的声音的参数如下：  
        public static int Ok = 0x00000000;
        public static int Error = 0x00000010;
        public static int Question = 0x00000020;
        public static int Warning = 0x00000030;
        public static int Information = 0x00000040;
        #endregion

        #region 鼠标状态
        /// <summary>
        /// 鼠标等待状态
        /// </summary>
        public static void WaitCursor()
        {
            Cursor.Current = Cursors.WaitCursor;
            Application.DoEvents();
        }
        /// <summary>
        /// 鼠标默认状态
        /// </summary>
        public static void DefaultCursor()
        {
            Cursor.Current = Cursors.Default;
            Application.DoEvents();
        }
        #endregion

        #region 打开输入法

        [DllImport("coredll.dll")]
        public extern static void SipShowIM(uint dwFlag);

        public static uint SIPF_OFF = 0x00;
        public static uint SIPF_ON = 0x01;

        #endregion
    }

}
